package ltd.jdsoft.cute.mybatis.manager;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import ltd.jdsoft.cute.mybatis.model.Student;
import ltd.jdsoft.cute.mybatis.service.StudentService;

@Component
public class StudentManager2 {

  @Autowired
  private StudentService studentService;

  public void add(Student student) {
    if (student.getAge() < 11) {
      throw new IllegalArgumentException("student too young!!");
    }
    studentService.add(student);
  }
}
